<?php
$kondisi = "";
$pesan   = "";

if (isset($_REQUEST["logout"])){ include "modul/logout.php";}
	
if (isset($_REQUEST["Signup"])){
    require_once 'class/config_database.php';
	require_once 'class/pengguna.php';
	require_once 'class/session.php';
	$session_dao  = new Session_Dao();
	$pengguna_dao = new Pengguna_Dao($host,$user,$pass,$dbnm);
	$pengguna     = new pengguna();
	// Proses salting password
	$session      = new Session();
	$session->Id_pengguna = "";
	$session->username    = $_POST["username"];
	$session->password    = $_POST["password"];
	$session->authority   = "";
	$session      = $session_dao->salting($session);
	//Proses unggah photo
	$pengguna->photo       =$pengguna_dao->unggah_photo();
	//Proses membentuk objek pengguna
	$pengguna->username    =$session->username;
	$pengguna->password    =$session->password;
	$pengguna->name        =$_POST["name"];
	$pengguna->address     =$_POST["address"];
	$pengguna->gender      =$_POST["gender"];
	$pengguna->city        =$_POST["city"];
	$pengguna->age         =$_POST["age"];
	$pengguna->email       =$_POST["email"];
	$pengguna->phone       =$_POST["phone"];
	$pengguna->other_info  =$_POST["other_info"];
	$pengguna->secret_key  =$_POST["secret_key"];
	$pengguna->status      ="0";
	$pengguna->authority   =$_POST["authority"];
	$pengguna->map_lock    =$_POST["map_lock"];
	$pengguna_dao->add($pengguna);
	$pesan = "Proses Sign Up Berhasil..";
}

if (isset($_REQUEST["Details"]))			  { include "modul/detailkamar.php";}
if (isset($_REQUEST["logout"]))				  { include "modul/logout.php";}
if (isset($_REQUEST["Signup"]))				  { include "modul/signup.php";}
if (isset($_REQUEST["Details"]))			  { include "modul/detailkamar.php";}
if (isset($_REQUEST["new_room"]))             { include "modul/new_room.php";}
if (isset($_REQUEST["tombol_update_profil"])) { include "modul/updateprofil.php";}
if (isset($_REQUEST["login"]))                {	include "modul/login.php";}
if (isset($_REQUEST["admin_terima"]))         {	include "modul/admin_terima.php";}
if (isset($_REQUEST["admin_tolak"]))          {	include "modul/admin_tolak.php";}
if (isset($_REQUEST["admin_edit"]))           {	include "modul/admin_edit.php";}
if (isset($_REQUEST["admin_hapus"]))          {	include "modul/admin_hapus.php";}
if (isset($_SESSION["Id_pengguna"]))		  { include "modul/session.php";}
